package com.geeke.sys.entity;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.geeke.common.persistence.DataEntity;
import com.geeke.org.entity.Company;

/**
 * 角色表Entity
 */
public class Role extends DataEntity<Role> {

    private static final long serialVersionUID = 1L;
    
    public Role() {
        super();
    }
    
    public Role(String id) {
        super(id);
    }

    @NotBlank(message = "名称不能为空")
    @Length(min = 1, max = 128, message = "名称长度必须介于1和128之间")
    private String name;
    
    @NotBlank(message = "编号不能为空")
    @Length(min = 1, max = 64, message = "编号长度必须介于1和64之间")
    private String code;
    
    @Length(min = 0, max = 255, message = "备注信息长度必须介于0和255之间")
    private String remarks;
    
    @NotBlank(message = "禁用不能为空")
    @Length(min = 1, max = 1, message = "禁用长度必须为1")
    private String isLocked = "0";
    
    private Company company = new Company();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
    
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    
    public String getIsLocked() {
        return isLocked;
    }

    public void setIsLocked(String isLocked) {
        this.isLocked = isLocked;
    }
    
    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    @Override
    public String getTableAlias() {
        return "role";
    }
} 